package com.example.demoserver;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class DemoServerApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoServerApplication.class, args);
	}

	@RequestMapping("/users")
	public List<Map<String,Object>> users(){
		List<Map<String,Object>> result = new ArrayList<>();

		Map<String,Object> zhangsan = new HashMap<>();
		zhangsan.put("name","张三");
		zhangsan.put("age","18");

		Map<String,Object> lisi = new HashMap<>();
		lisi.put("name","李四");
		lisi.put("age","20");

		result.add(zhangsan);
		result.add(lisi);

		return result;
	}

}
